/*
 * Copyright (C) 2007-2012 by XDEV Software, All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 3.0 as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
package xdev.util.logging;


import java.text.MessageFormat;
import java.util.logging.Logger;


/**
 * {@link XdevLogger} is a thin wrapper around the java.util.logging
 * package. It provides many shortcuts for everyday logging situations.
 * 
 * 
 *
 * @author XDEV Software (RHHF)
 * 
 */
public interface XdevLogger
{
	
	/**
	 * Log an exception (throwable) at the ERROR level.
	 * 
	 * 
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 * 
	 */
	public abstract void error(final Throwable thrown);
	

	/**
	 * Log an exception (throwable) at the ERROR level with an accompanying
	 * message.
	 * 
	 * @param msg
	 *            the message accompanying the exception
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 */
	public abstract void error(final Throwable thrown, final String msg);
	

	/**
	 * Log a message at the ERROR level according to the specified message and
	 * arguments.
	 * 
	 * <p>
	 * The arguments will be integrated using the {@link MessageFormat} syntax.
	 * </p>
	 * 
	 * 
	 * @param msg
	 *            the format string
	 * @param args
	 *            an array of arguments
	 * 
	 * @see MessageFormat
	 */
	public abstract void error(final String msg, final Object... args);
	

	/**
	 * Log an exception (throwable) at the WARNING level.
	 * 
	 * 
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 * 
	 */
	public abstract void warning(final Throwable thrown);
	

	/**
	 * Log an exception (throwable) at the WARNING level with an accompanying
	 * message.
	 * 
	 * @param msg
	 *            the message accompanying the exception
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 */
	public abstract void warning(final Throwable thrown, final String msg);
	

	/**
	 * Log a message at the WARNING level according to the specified message and
	 * arguments.
	 * 
	 * <p>
	 * The arguments will be integrated using the {@link MessageFormat} syntax.
	 * </p>
	 * 
	 * 
	 * @param msg
	 *            the format string
	 * @param args
	 *            an array of arguments
	 * 
	 * @see MessageFormat
	 */
	public abstract void warning(final String msg, final Object... args);
	

	/**
	 * Log an exception (throwable) at the INFO level.
	 * 
	 * 
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 * 
	 */
	public abstract void info(final Throwable thrown);
	

	/**
	 * Log an exception (throwable) at the WARNING level with an accompanying
	 * message.
	 * 
	 * @param msg
	 *            the message accompanying the exception
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 */
	public abstract void info(final Throwable thrown, final String msg);
	

	/**
	 * Log a message at the INFO level according to the specified message and
	 * arguments.
	 * 
	 * <p>
	 * The arguments will be integrated using the {@link MessageFormat} syntax.
	 * </p>
	 * 
	 * 
	 * @param msg
	 *            the format string
	 * @param args
	 *            an array of arguments
	 * 
	 * @see MessageFormat
	 */
	public abstract void info(final String msg, final Object... args);
	

	/**
	 * Log a message at the INFO level.
	 * 
	 * @param msg
	 *            the message to log
	 * 
	 */
	public abstract void info(final String msg);
	

	/**
	 * Is the logger instance enabled for the DEBUG level?
	 * 
	 * @return <code>true</code> if this Logger is enabled for the DEBUG level,
	 *         <code>false</code> otherwise.
	 * 
	 */
	public abstract boolean isDebugEnabled();
	

	/**
	 * Is the logger instance enabled for the ERROR level?
	 * 
	 * @return <code>true</code> if this Logger is enabled for the ERROR level,
	 *         <code>false</code> otherwise.
	 * 
	 */
	public abstract boolean isErrorEnabled();
	

	/**
	 * Is the logger instance enabled for the WARNING level?
	 * 
	 * @return <code>true</code> if this Logger is enabled for the WARNING
	 *         level, <code>false</code> otherwise.
	 * 
	 */
	public abstract boolean isWarningEnabled();
	

	/**
	 * Is the logger instance enabled for the INFO level?
	 * 
	 * @return <code>true</code> if this Logger is enabled for the INFO level,
	 *         <code>false</code> otherwise.
	 * 
	 */
	public abstract boolean isInfoEnabled();
	

	/**
	 * Log an exception (throwable) at the DEBUG level.
	 * 
	 * 
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 * 
	 */
	public abstract void debug(final Throwable thrown);
	

	/**
	 * Log an exception (throwable) at the DEBUG level with an accompanying
	 * message.
	 * 
	 * @param msg
	 *            the message accompanying the exception
	 * @param thrown
	 *            the exception (throwable) to log
	 * 
	 */
	public abstract void debug(final Throwable thrown, final String msg);
	

	/**
	 * Log a message at the DEBUG level according to the specified message and
	 * arguments.
	 * 
	 * <p>
	 * The arguments will be integrated using the {@link MessageFormat} syntax.
	 * </p>
	 * 
	 * 
	 * @param msg
	 *            the format string
	 * @param args
	 *            an array of arguments
	 * 
	 * @see MessageFormat
	 */
	public abstract void debug(final String msg, final Object... args);
	

	/**
	 * Log a message at the DEBUG level.
	 * 
	 * @param msg
	 *            the message to log
	 * 
	 */
	public abstract void debug(final String msg);
	

	/**
	 * Log a message at the WARNING level.
	 * 
	 * @param msg
	 *            the message to log
	 * 
	 */
	public abstract void warning(final String msg);
	

	/**
	 * Log a message at the ERROR level.
	 * 
	 * @param msg
	 *            the message to log
	 * 
	 */
	public abstract void error(final String msg);
	

	/**
	 * Returns {@link Logger} instance that backs this {@link XdevLoggerImpl}.
	 * 
	 * @return {@link Logger} instance that backs this {@link XdevLoggerImpl}.
	 */
	public abstract Logger getLogger();
	
}
